/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package TextManager;

import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;

/**
 *
 * @author jaime
 */
public class CommonWordsFilter {
    
    private HashMap<String, WordOccurrence> commonWords;
    
    public CommonWordsFilter()
    {
        commonWords = new HashMap<String, WordOccurrence>();
        
        put(new WordOccurrence("A"));
        put(new WordOccurrence("AS"));
        put(new WordOccurrence("O"));
        put(new WordOccurrence("OS"));
        put(new WordOccurrence("AOS"));
        put(new WordOccurrence("ÀS"));
        put(new WordOccurrence("À"));
        put(new WordOccurrence("E"));
        put(new WordOccurrence("É"));
        put(new WordOccurrence("DE"));
        put(new WordOccurrence("DO"));
        put(new WordOccurrence("DOS"));
        put(new WordOccurrence("DA"));
        put(new WordOccurrence("DAS"));
        put(new WordOccurrence("PARA"));
        put(new WordOccurrence("EM"));
        put(new WordOccurrence("NO"));
        put(new WordOccurrence("NOS"));
        put(new WordOccurrence("NA"));
        put(new WordOccurrence("NAS"));
        put(new WordOccurrence("QUE"));
        put(new WordOccurrence("COM"));
        put(new WordOccurrence("COMO"));
        put(new WordOccurrence("POR"));
        put(new WordOccurrence("PELO"));
        put(new WordOccurrence("PELA"));
        put(new WordOccurrence("PELOS"));
        put(new WordOccurrence("PELAS"));
        put(new WordOccurrence("MAS"));
        put(new WordOccurrence("OU"));
        put(new WordOccurrence("NÃO"));
        put(new WordOccurrence("SIM"));
        put(new WordOccurrence("FOI"));
        put(new WordOccurrence("SÃO"));
        put(new WordOccurrence("SUA"));
        put(new WordOccurrence("SEU"));
        put(new WordOccurrence("ELE"));
        put(new WordOccurrence("ELA"));
        put(new WordOccurrence("TEVE"));
        put(new WordOccurrence("SER"));
        put(new WordOccurrence("ELES"));
        put(new WordOccurrence("ELAS"));
        put(new WordOccurrence("ESTE"));
        put(new WordOccurrence("ESTA"));
        put(new WordOccurrence("ESTES"));
        put(new WordOccurrence("ESTAS"));
        put(new WordOccurrence("ISTO"));
        put(new WordOccurrence("FORAM"));
        put(new WordOccurrence("TER"));
        put(new WordOccurrence("TEM"));
        put(new WordOccurrence("TÊM"));
        put(new WordOccurrence("ASSIM"));
        put(new WordOccurrence("SIDO"));
        put(new WordOccurrence("LÁ"));
        put(new WordOccurrence("ALGUM"));
        put(new WordOccurrence("ALGUNS"));
        put(new WordOccurrence("MAIS"));
        put(new WordOccurrence("MENOS"));
        put(new WordOccurrence("ENTÃO"));
        put(new WordOccurrence("AGORA"));
        
        
        
    }
    
    private void put(WordOccurrence word)
    {
        commonWords.put(word.getContent(), word);
    }
    
    /**
     * Returns whether a word is common or not (and may not be included).
     * Common words, such as prepositions or articles are common.
     * @return If the word is common or not.
     */
    public boolean isCommon(WordOccurrence word)
    {
        if(commonWords.containsKey(word.getContent()))
        {
            return true;
        }
        else
        {
            return false;
        }
                
    }
    
}
